import router from './router/index'
import store from './store/index'
router.beforeEach((to, from, next) => {
    if (store.state.token) {
        if (to.path == '/') {
            alert('您已登陆登录！')
            next(false)
        } else {
            next()
        }
    } else {
        if (to.path == '/') {
            next()
        } else {
            alert('请先登录！')
            next(false)
        }
    }

})